//
//  HomeViewController.m
//  DelegateDemo
//
//  Created by UniHan_iMac on 17/3/27.
//  Copyright © 2017年 UniHan_iMac. All rights reserved.
//

#import "HomeViewController.h"
#import "ChangeColorViewController.h"

@interface HomeViewController ()<ChangeColorDelegate>

@end

@implementation HomeViewController

- (IBAction)GoNextPage:(id)sender {
    ChangeColorViewController *changeVC = [[ChangeColorViewController alloc] init];
    // 设置代理
    changeVC.delegate = self;
    [self.navigationController pushViewController:changeVC animated:YES];
}
// 实现代理的协议方法
-(void)ChangeColor:(int)tag ChangeText:(NSString *)string{
    self.view.backgroundColor = [UIColor greenColor];
    [self.color setTitle:string forState:UIControlStateNormal];
}
-(void)ChangeButtonColor{
    self.color.backgroundColor = [UIColor yellowColor];
}

- (void)viewDidLoad {
    [super viewDidLoad];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
